<style type="text/css">
    .sort {display: none;}
</style>
<div class="p-head">
    <b class="c3">分类</b>
    <div class="r">
        <a href="/bbs/index/3/" class="ajax" title="意见反馈">意见反馈</a>
    </div>
    <div id="desc">
        记录每天生活的点点滴滴。。。
    </div>
</div>
<div class="tabs_t tabs_n">
    <ul class="ajax" id="tabs_l">
        <li class="current"><a href="/category/">收支分类</a></li>                        
        <li><a href="/account/">账户管理</a></li>
        <li><a href="/family/">家庭管理</a></li>
        <li><a href="/task/">定时记账</a></li>
    </ul>
    <span class="r clear">
    </span>
</div>
<div id="bbs">
    <div class="span6">
        <table class="data list form" cellpadding="0" cellspacing="1" width="100%" style="margin-top:10px;" width="50%">
            <tbody>
                <tr>
                    <td colspan="2" style="text-align:left;">
                        <button class="btn btn_b_s btn_d_h"><span><b></b><em>支出分类</em></span></button>
                    </td>
                    <td>
                        <a class="btn btn_w_s dialog" href="/category/add/expense/" title="新增支出分类" close="true" callback="category_callback"><span><b class="icon icon-edit"></b><em>新增</em></span></a>
                    </td>
                </tr>
                <tr>
                    <th style="text-align:left;text-indent:25px">名称</th>
                    <th width="32"></th>
                    <th width="100">操作</th>
                </tr>
                <?php foreach (get_category_list_full('expense', true) as $m => $n) { ?>
                    <tr cid="<?= $m ?>" father_id="<?= $n['father_id'] ?>">
                        <td class="tl"><?= $n['name'] ?></td>
                        <td><a class="light <?= $n['state'] ? '' : 'lightoff' ?>" href="javascript:;">&nbsp;</a></td>
                        <td>
                            <span>
                                <?php if (!$n['system']) { ?>
                                    <a href="javascript:;" color="b" class="itedit"> 编辑</a> | 
                                    <a href="/category/del/<?= $n['id'] ?>/" class="del" callback="category_delete"> 删除</a>
                                <?php } else { ?>
                                    <a href="javascript:;" style="color:gray" title="系统分类,不能编辑和删除"> 系统分类</a>
                                <?php } ?>
                            </span>
                        </td>
                    </tr>
                    <?php foreach ($n['sons'] as $u => $v) { ?>
                        <tr cid="<?= $u ?>" father_id="<?= $v['father_id'] ?>">
                            <td class="tl tli"><?= $v['name'] ?></td>
                            <td><a class="light <?= $n['state'] && $v['state'] ? '' : 'lightoff' ?>" href="javascript:;">&nbsp;</a></td>
                            <td>
                                <span>
                                    <?php if (!$v['system']) { ?>
                                        <a href="javascript:;" color="b" class="itedit"> 编辑</a> | 
                                        <a href="/category/del/<?= $v['id'] ?>/" class="del"> 删除</a>
                                    <?php } else { ?>
                                        <a href="javascript:;" style="color:gray" title="系统分类,不能编辑和删除"> 系统分类</a>
                                    <?php } ?>
                                </span>
                            </td>
                        </tr>
                    <?php } ?>
                <?php } ?>
            </tbody>
        </table>
    </div>
    <div class="span6">
        <table class="data list form" cellpadding="0" cellspacing="1" width="100%" style="margin-top:10px;" width="50%">
            <tbody>
                <tr>
                    <td colspan="2" style="text-align:left;">
                        <button class="btn btn_g_s btn_d_h"><span><b></b><em>收入分类</em></span></button>
                    </td>
                    <td>
                        <a class="btn btn_w_s dialog" href="/category/add/income/" title="新增收入分类" close="true" callback="category_callback"><span><b class="icon icon-edit"></b><em>新增</em></span></a>
                    </td>
                </tr>
                <tr>
                    <th style="text-align:left;text-indent:25px">名称</th>
                    <th width="32"></th>
                    <th width="100">操作</th>
                </tr>
                <?php foreach (get_category_list_full('income', true) as $m => $n) { ?>
                    <tr cid="<?= $m ?>" father_id="<?= $n['father_id'] ?>">
                        <td class="tl"><?= $n['name'] ?></td>
                        <td><a class="light <?= $n['state'] ? '' : 'lightoff' ?>" href="javascript:;">&nbsp;</a></td>
                        <td>
                            <span>
                                <?php if (!$n['system']) { ?>
                                    <a href="javascript:;" color="g" class="itedit"> 编辑</a> | 
                                    <a href="/category/del/<?= $m ?>/" class="del" callback="category_delete"> 删除</a>
                                <?php } else { ?>
                                    <a href="javascript:;" style="color:gray" title="系统分类,不能编辑和删除"> 系统分类</a>
                                <?php } ?>
                            </span>
                        </td>
                    </tr>
                    <?php foreach ($n['sons'] as $u => $v) { ?>
                        <tr cid="<?= $u ?>" father_id="<?= $v['father_id'] ?>">
                            <td class="tl tli"><?= $v['name'] ?></td>
                            <td><a class="light <?= $n['state'] && $v['state'] ? '' : 'lightoff' ?>" href="javascript:;">&nbsp;</a></td>
                            <td>
                                <span>
                                    <?php if (!$v['system']) { ?>
                                        <a href="javascript:;" color="g" class="itedit"> 编辑</a> | 
                                        <a href="/category/del/<?= $u ?>/" class="del"> 删除</a>
                                    <?php } else { ?>
                                        <a href="javascript:;" style="color:gray" title="系统分类,不能编辑和删除"> 系统分类</a>
                                    <?php } ?>
                                </span>
                            </td>
                        </tr>
                    <?php } ?>
                <?php } ?>
            </tbody>
        </table>
    </div>
</div>
<script type="text/javascript">
    KS.common.load('category.index');
</script>